.TH std::insert_iterator::insert_iterator 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::insert_iterator::insert_iterator \- std::insert_iterator::insert_iterator

.SH Synopsis
   insert_iterator( Container& c, typename Container::iterator i );       \fI(until C++20)\fP
   constexpr insert_iterator( Container& c,                               \fI(since C++20)\fP
   ranges::iterator_t<Container> i );

   Initializes the underlying pointer to the container to std::addressof(c) and the
   underlying iterator to i.

.SH Parameters

   c - container to initialize the inserter with
   i - iterator to initialize the inserter with

   Defect reports

   The following behavior-changing defect reports were applied retroactively to
   previously published C++ standards.

     DR    Applied to           Behavior as published              Correct behavior
   LWG 561 C++98      the type of i was independent of          it is the iterator type
                      Container                                 of Container
   P2325R3 C++20      default constructor was provided as C++20 removed along with the
                      iterators must be default_initializable   requirement
